Optimal. Leaf size=156 \[ \frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {2^{\frac {1}{2}+n} \left (1+n+n^2\right ) \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {1}{2}-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x))\right ) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n}{d (1+n) (2+n)}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2838, 2830,
2731, 2730} \begin {gather*} -\frac {2^{n+\frac {1}{2}} \left (n^2+n+1\right ) \cos (c+d x) (\sin (c+d x)+1)^{-n-\frac {1}{2}} (a \sin (c+d x)+a)^n \, _2F_1\left (\frac {1}{2},\frac {1}{2}-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x))\right )}{d (n+1) (n+2)}+\frac {\cos (c+d x) (a \sin (c+d x)+a)^n}{d \left (n^2+3 n+2\right )}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2730
Rule 2731
Rule 2830
Rule 2838
Rubi steps
\begin {align*} \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx &=-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}+\frac {\int (a (1+n)-a \sin (c+d x)) (a+a \sin (c+d x))^n \, dx}{a (2+n)}\\ &=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}+\frac {\left (1+n+n^2\right ) \int (a+a \sin (c+d x))^n \, dx}{(1+n) (2+n)}\\ &=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}+\frac {\left (\left (1+n+n^2\right ) (1+\sin (c+d x))^{-n} (a+a \sin (c+d x))^n\right ) \int (1+\sin (c+d x))^n \, dx}{(1+n) (2+n)}\\ &=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {2^{\frac {1}{2}+n} \left (1+n+n^2\right ) \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {1}{2}-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x))\right ) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n}{d (1+n) (2+n)}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 6 vs. order 5 in
optimal.
time = 49.87, size = 28439, normalized size = 182.30 \begin {gather*} \text {Result too large to show} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.39, size = 0, normalized size = 0.00 \[\int \left (\sin ^{2}\left (d x +c \right )\right ) \left (a +a \sin \left (d x +c \right )\right )^{n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \left (\sin {\left (c + d x \right )} + 1\right )\right )^{n} \sin ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\sin \left (c+d\,x\right )}^2\,{\left (a+a\,\sin \left (c+d\,x\right )\right )}^n \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________